﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="userPanel.aspx.cs" Inherits="Presentation.Content.panelUsuario" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Panel de Usuario - Academy Manager</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <a name="panel"></a>
    <h1>
        Panel de Usuario</h1>
    <form id="frmPanel" runat="server">
    <asp:MultiView ID="mvDdlMain" runat="server" ActiveViewIndex="-1">
        <asp:View ID="vDDL" runat="server">
            <table>
                <tr>
                    <td>
                        Seleccionar funcionalidad:
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlMain" runat="server" OnSelectedIndexChanged="ddlMain_SelectedIndexChanged"
                            AutoPostBack="True">
                            <asp:ListItem Value="none">Elija una funcionalidad...</asp:ListItem>
                            <asp:ListItem Value="New">Agregar nuevo</asp:ListItem>
                            <asp:ListItem Value="AddModify">Modificar</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <asp:MultiView ID="mvSearch" runat="server" ActiveViewIndex="-1">
        <asp:View ID="View1" runat="server">
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="txtSearch" runat="server" MaxLength="40"></asp:TextBox>
                </td>
                <td>
                                <asp:DropDownList ID="ddlSearch" runat="server" AutoPostBack="True">
                                </asp:DropDownList>
                            </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" Text="Buscar" CssClass="boton" 
                        onclick="btnSearch_Click" />
                </td>
            </tr>
        </table>
                    <asp:GridView ID="gvPeople" runat="server" AutoGenerateColumns="False" 
                onselectedindexchanged="gvPeople_SelectedIndexChanged" >
                        <Columns>
                            <asp:BoundField AccessibleHeaderText="Numero" DataField="Numero" HeaderText="Numero">
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:BoundField AccessibleHeaderText="Nombres" DataField="Nombres" HeaderText="Nombres">
                                <ItemStyle HorizontalAlign="Justify" />
                            </asp:BoundField>
                            <asp:BoundField AccessibleHeaderText="Apellidos" DataField="Apellidos" HeaderText="Apellidos">
                                <ItemStyle HorizontalAlign="Justify" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Seleccionar">
                                <ItemTemplate>
                                    <asp:Button ID="btnSelect" runat="server" CausesValidation="false" CommandName="Select"
                                        Text="Seleccionar" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Seleccionar">
                                <ItemTemplate>
                                    <asp:Button ID="btnDelete" runat="server" CausesValidation="false" CommandName="Select"
                                        Text="Eliminar" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                
        </asp:View>
    </asp:MultiView>
    <asp:MultiView ID="mvMain" runat="server" ActiveViewIndex="-1">
        <asp:View ID="vNewModifyPerson" runat="server">
            <table>
                <tr>
                    <td>
                        <asp:Image ID="imgDemo" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <br />
                        <asp:FileUpload ID="FileUploadControl" runat="server" />
                        <br />
                        <asp:Button ID="UploadButton" runat="server" Text="Cargar foto" OnClick="UploadButton_Click" />
                        <br />
                        <asp:Label runat="server" ID="statusLabel" Text="Status: " />
                    </td>
                </tr>
            </table>
            <table>
                <asp:MultiView ID="mvUserType" runat="server" ActiveViewIndex="0">
                    <asp:View ID="vUserType" runat="server">
                        <tr>
                            <td>
                                Tipo de usuario:
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlUserType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlUserType_SelectedIndexChanged">
                                    <asp:ListItem Value="none">Elija un tipo...</asp:ListItem>
                                    <asp:ListItem Value="Administrator">Administrador</asp:ListItem>
                                    <asp:ListItem Value="Teacher">Docente</asp:ListItem>
                                    <asp:ListItem Value="Student">Estudiante</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </asp:View>
                </asp:MultiView>
                <tr>
                    <td>
                        Número de registro:
                    </td>
                    <td>
                        <asp:Label ID="lblNroId" runat="server"></asp:Label>&nbsp;&nbsp;<br />
                    </td>
                </tr>
                <tr>
                    <td>
                        Primer Nombre:
                    </td>
                    <td>
                        <asp:TextBox ID="txtFstName" ValidationGroup="gPanel" runat="server" MaxLength="40"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="Debe ingresar un nombre."
                            ControlToValidate="txtFstName" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Segundo Nombre:
                    </td>
                    <td>
                        <asp:TextBox ID="txtSecName" ValidationGroup="gPanel" runat="server" MaxLength="40"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Primer Apellido:
                    </td>
                    <td>
                        <asp:TextBox ID="txtFstSurname" ValidationGroup="gPanel" runat="server" MaxLength="40"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvSurname" runat="server" ErrorMessage="Debe ingresar un apellido."
                            ControlToValidate="txtFstSurname" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Segundo Apellido:
                    </td>
                    <td>
                        <asp:TextBox ID="txtSecSurname" ValidationGroup="gPanel" runat="server" MaxLength="40"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        E-mail:
                    </td>
                    <td>
                        <asp:TextBox ID="txtMail" runat="server" ValidationGroup="gPanel" MaxLength="40"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RegularExpressionValidator ID="revMail" runat="server" ErrorMessage="Debe ingresar un e-mail válido."
                            ControlToValidate="txtMail" ValidationGroup="gPanel" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="rfvMail" runat="server" ErrorMessage="Debe ingresar una dirección de e-mail."
                            ControlToValidate="txtMail" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Celular:
                    </td>
                    <td>
                        <asp:TextBox ID="txtCell" runat="server" ValidationGroup="gPanel" MaxLength="10"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvTel" runat="server" ErrorMessage="Debe ingresar un número de celular válido."
                            ControlToValidate="txtCell" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Teléfono:
                    </td>
                    <td>
                        <asp:TextBox ID="txtTel" runat="server" ValidationGroup="gPanel" MaxLength="10"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Dirección:
                    </td>
                    <td>
                        <asp:TextBox ID="txtAddress" runat="server" ValidationGroup="gPanel" MaxLength="100"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvAddress" runat="server" ErrorMessage="Debe ingresar una dirección."
                            ControlToValidate="txtAddress" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Tipo de documento:
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlDocType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDocType_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <asp:MultiView ID="mvSelDocType" runat="server" ActiveViewIndex="-1">
                    <asp:View ID="vOtherDocType" runat="server">
                        <tr>
                            <td>
                                Otro tipo de documento:
                            </td>
                            <td>
                                <asp:TextBox ID="txtOtherDocType" runat="server" ValidationGroup="gPanel" MaxLength="100"></asp:TextBox>
                            </td>
                        </tr>
                    </asp:View>
                </asp:MultiView>
                <tr>
                    <td>
                        Documento:
                    </td>
                    <td>
                        <asp:TextBox ID="txtDoc" runat="server" ValidationGroup="gPanel" MaxLength="10"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Debe ingresar un documento."
                            ControlToValidate="txtDoc" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        Comentarios:
                    </td>
                    <td>
                        <asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" MaxLength="200">
                        </asp:TextBox>
                    </td>
                </tr>
            </table>
            <table>
                <asp:MultiView ID="mvUserPass" runat="server" ActiveViewIndex="0">
                    <asp:View ID="vUserPass" runat="server">
                        <tr>
                            <td>
                                Nombre de usuario:
                            </td>
                            <td>
                                <asp:TextBox ID="txtUsername" runat="server" MaxLength="40"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="lblErrUserNotWritten" runat="server"></asp:Label>&nbsp;&nbsp;<br />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Contraseña:
                            </td>
                            <td>
                                <asp:TextBox ID="txtPass" runat="server"  MaxLength="40"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="lblErrPassNotWritten" runat="server"></asp:Label>&nbsp;&nbsp;<br />
                            </td>
                        </tr>
                        <%--<asp:MultiView ID="mvConfirmPass" runat="server" ActiveViewIndex="-1">
                            <asp:View ID="vConfirmPass" runat="server">
                                <tr>
                                    <td colspan="3" style="text-align: left">
                                        Si modifica su contraseña debe rellenar los siguientes campos:
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Confirmar contraseña:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtConPass" runat="server" MaxLength="20"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblErrPass" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Contraseña antigua:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtOldPass" runat="server" MaxLength="20"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblErrOld" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                            </asp:View>
                        </asp:MultiView>--%>
                    </asp:View>
                </asp:MultiView>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:MultiView ID="mvButtons" runat="server" ActiveViewIndex="-1">
                            <asp:View ID="vBtnModify" runat="server">
                                <asp:Button ID="btnModificar" runat="server" Text="Guardar cambios" CssClass="boton"
                                    ValidationGroup="gPanel" OnClick="btnModificar_Click" />
                            </asp:View>
                            <asp:View ID="vBtnNew" runat="server">
                                <asp:Button ID="btnNew" runat="server" Text="Agregar nuevo" CssClass="boton" ValidationGroup="gPanel
                                " OnClick="btnNew_Click" />
                            </asp:View>
                        </asp:MultiView>
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <asp:Label ID="lblInfo" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
    </form>
    <script type="text/javascript">
        window.onload = function () {
            var ele = document.getElementById("content_lblInfo");

            if (ele.innerHtml != "") {
                window.setTimeout(function () { ele.innerHTML = ""; }, 5000);
            }
        };
    </script>
</asp:Content>
